import {
  request,
  _post,
  _get,
  _put
} from '../request';

// 投诉建议相关
// 投诉建议详情
export function viewSuggestDetail(data) {
  return _get({
    url: `crm/pt/agent-complaints/action/detail`,
    data,
  });
}

// 分派投诉建议
export function dispatchSuggest(data) {
  return _post({
    url: `crm/pt/agent-complaints/action/dispatch-complaint`,
    data,
  });
}

// 操作投诉建议
export function dealSuggest(data) {
  return _put({
    url: `crm/pt/agent-complaints/action/operator`,
    data,
  });
}

// 业务员处理投诉建议
export function processcomplaint(data, header) {
  console.log(header, 'aaa')
  return _post({
    url: `crm/pt/agent-complaints/action/process-complaint`,
    data,
    header
  });
}

//代理商发起投诉建议
export function startcomplaint(data, header) {
  return _post({
    url: `crm/pt/agent-complaints/action/start-complaint`,
    data,
    header
  });
}
// 编辑投诉建议
export function editSuggest(data) {
  return _put({
    url: `crm/pt/agent-complaints/action/update`,
    data,
  });
}

// 代理商获取所有的投诉建议
// 代理商和员工公用  参数不一样
export function getSuggestList(data, headers) {
  return _post({
    url: `crm/pt/agent-complaints/action/list-page`,
    data,
  }, headers);
}

// 代理商删除投诉建议

export function deleteSuggest(data, header) {
  return _put({
    url: `crm/pt/agent-complaints/action/operator`,
    data,
    header
  });
}
// 通知消息服务

//管理员分页查询已经发送的通知消息

export function adminCheckNews(data, header) {
  return _post({
    url: `crm/pt/message-notify/action/admin-list-page`,
    data,
    header
  }, );
}

//  代理商分页拉取通知消息

export function agentNews(data, header) {
  console.log(header);
  return _post({
    url: `crm/pt/message-notify/action/agent-pull-msg`,
    data,
    header
  });
}

// 发送通知消息
export function sendNews(data, headers) {
  return _post({
    url: `crm/pt/message-notify/action/send`,
    data,
  }, headers);
}
// 回执消息已读
export function readdNews(data, headers) {
  return _post({
    url: `crm/pt/message-notify/action/send-ack`,
    data,
  }, headers);
}

// 小区统计

export function subdistrictgroupstats(data) {
  return _get({
    url: `crm/pt/customerss/action/subdistrict-group-customer-stats`,
    data,
  });
}